package org.hgvc.webapp.ets.spring.service;

import java.util.Date;
import java.util.List;

import org.hgvc.webapp.ets.bo.Agent;
import org.hgvc.webapp.ets.bo.Agreement;
import org.hgvc.webapp.ets.bo.CommissionSchemaPaymentRange;
import org.hgvc.webapp.ets.bo.DocCheckList;
import org.hgvc.webapp.ets.bo.DocSubmission;
import org.hgvc.webapp.ets.bo.InstallmentSchema;
import org.hgvc.webapp.ets.bo.Invoice;
import org.hgvc.webapp.ets.bo.InvoiceDtl;
import org.hgvc.webapp.ets.bo.Member;
import org.hgvc.webapp.ets.bo.MemberBooking;
import org.hgvc.webapp.ets.bo.MemberComp;
import org.hgvc.webapp.ets.bo.MemberInd;
import org.hgvc.webapp.ets.bo.MemberIndAcct;
import org.hgvc.webapp.ets.bo.MemberInstallmentPlan;
import org.hgvc.webapp.ets.bo.MemberPaymentPlan;
import org.hgvc.webapp.ets.bo.MemberPointEntitle;
import org.hgvc.webapp.ets.bo.MemberTransaction;
import org.hgvc.webapp.ets.bo.Membership;
import org.hgvc.webapp.ets.bo.MicTask;
import org.hgvc.webapp.ets.bo.Package;
import org.hgvc.webapp.ets.bo.PartnerProduct;
import org.hgvc.webapp.ets.bo.Payment;
import org.hgvc.webapp.ets.bo.PaymentDtl;
import org.hgvc.webapp.ets.bo.StandingInstruction;
import org.jocsb.base.bo.User;
import org.jocsb.base.exception.BaseException;


public interface MemberService {

	public List<Member> getMemberList() throws BaseException;
	public List<MemberInd> getMemberIndList(String membershipNo,String memberName,String icNo)throws BaseException;
	public MemberIndAcct getMemberIndAcctByMemberId(String memberId)throws BaseException;
	public MemberComp getMemberCompByMemberId(String memberId)throws BaseException;
	public void editMemberComp(Member member, MemberComp memberComp)
	throws BaseException;
	public void editMemberIndAcct(Member member, MemberInd memberInd,
			MemberIndAcct memberIndAcct) throws BaseException;
	public void deleteMemberList(List<Member> memberList,User user) throws BaseException;
	public void createMemberPaymentPlan(MemberPaymentPlan payment,List<MemberInstallmentPlan> list,Member member)throws BaseException;
	public MemberPaymentPlan getMemberPaymentPlanInfo(Member member)throws BaseException;
	public List<MemberInstallmentPlan> getMemberInstallmentPlanListByMemberId(String memberId)throws BaseException;
	public Member getMemberByUserId(String userId)throws BaseException;
	public MemberInd getMemberIndByMemberId(String memberId)throws BaseException;
	public List<MemberIndAcct> getMemberIndAcctByMemberInd(String ind)throws BaseException;
	public List<MemberIndAcct> getMemberIndAcctByMemberComp(String ind)throws BaseException;
	public Member getMemberById(String id)throws BaseException;
	public void generateMemberAgreement(Member member,Agreement agreement,User user,String actionNo, boolean newAgreementExistingMember)throws BaseException, Exception;
	public void deleteDocCheckList(List<DocCheckList> checklist,User createUser)throws BaseException;
	public void editDocCheckList(DocCheckList checklist,User createUser)throws BaseException;
	public void createDocCheckList(DocCheckList checklist,User createUser)throws BaseException;
	public List<DocCheckList> getDocCheckListList()throws BaseException;
	public List<Member> searchRegNoPartnerNameInList(String regno,List<Member> memberList)throws BaseException;
	public List<Member> getProspectMemberList()throws BaseException;
	public List<DocSubmission> getMemberDocSubmissionList(String memberId,String type)throws BaseException;
	public void checkMemberDoc(Member member,List<DocSubmission> mandList,List<DocSubmission> notmandList,User checkUser)throws BaseException;
	public void completeCheckMemberDoc(Member member,List<DocSubmission> mandList,List<DocSubmission> notmandList,User checkUser)throws BaseException;
	public void memberConversion(Member member,User user)throws BaseException;
	public Payment createProspectIndividualMember(Member member,MemberInd memberInd,List<MemberIndAcct> list,
			User createdUser,Payment payment,PaymentDtl paytmentDtl,StandingInstruction instruction
			,Agreement agreement,double actualPayment)throws BaseException;
	public Payment createProspectCompMember(Member member,MemberComp memberComp,
			User createdUser,
			List<MemberIndAcct> list,
			Payment payment,PaymentDtl paytmentDtl,StandingInstruction instruction
			,Agreement agreement,double actualPayment)throws BaseException;
	public Agreement getAgreementByMemberId(String memberId)throws BaseException;
	public List<Member> getProspectMemberList(Agent agent)throws BaseException;
	public List<Agreement> getAgreementListByMemberId(String memberId)throws BaseException;
	public List<MemberPointEntitle> getMemberPointEntitleList(String agreementId)throws BaseException;
	public void updateMemberIndProfileAction(Member member,MemberInd memberind,List<MemberIndAcct> dList,User user)throws BaseException;
	public void updateMemberCompProfileAction(Member member,MemberComp memberComp,List<MemberIndAcct> dList,User user)throws BaseException;
	
	public List<Member> getMemberActiveList()throws BaseException;
	public List<InvoiceDtl> getInvoiceDtlByAgreementId(String id)throws BaseException;
	public Payment memberAddNewAgreement(Member member,StandingInstruction si, User createdUser,Payment payment,PaymentDtl paymentDtl,Agreement agreement
			, double actualPayment)throws BaseException;
	public List<Invoice> getInvoiceByAgreementId(String id)throws BaseException;
	
	public List<Member> getMemberListByAgent(Agent agent)throws BaseException;
	public Payment memberMakePayment(Agreement agreement,User user,double amt,double actualAmt,Invoice invoice,InvoiceDtl invoiceDtl)throws BaseException;
	
	
	public List<MemberPointEntitle> getMemberPointEntitleList(String agreementId,String pointCatId)throws BaseException;
	
	public String generatePreMembershipNo(Member member)throws BaseException;
	public void systemAutoProspectConversion()throws BaseException;
	
	public void reserveMemberPoint(String agreementId,Integer totalPointsReserved)throws BaseException;
	public void deductMemberPoint(String agreementId,Integer totalPointsDeducted)throws BaseException;
	public void validateMemberPoint(String agreementId,Integer pointRequired)throws BaseException;
	public void cancelMemberPoint(String agreementId,Integer totalPointsReserved)throws BaseException;
	
	
	public List<MemberTransaction> getMemberTransactionList(String agreementId)throws BaseException;
	public void insertMemberTransaction(String agreementId,String transactionDesc)throws BaseException;
	public void reActivateUserAccount(User user)throws BaseException;
	
	public String getMembershipName(Member member)throws BaseException;
	
	public void reserveMemberPoint(Package bookingPackage, String agreementNo, Integer year, int goldPoint, int silverPoint) throws BaseException ;
	public void insertMemberTransaction( String agreementNo, Integer year, String newBookingTransactionDesc)throws BaseException ;

	public void cancelMemberPoint2(MemberBooking memberBooking)throws BaseException;
	public void deductMemberPoint2(MemberBooking memberBooking)throws BaseException;
	public void reverseConfirmMemberPoint(MemberBooking memberBooking) throws BaseException;
	public List<Member> getMemberActiveList(Agent agent) throws BaseException;
	public void saveAgreenmentTransfer(Member member, Agreement agreement, MemberComp memberComp, double invoiceCharge, String remark) throws Exception;
	public void saveAgreenmentTransfer(Member member, Agreement agreement, MemberInd memberInd, double invoiceCharge, String remark)throws Exception;
 	public void saveAgentAgreementTransfer(Agent agent, Agent toAgent, List<Agreement> agreements, User user) throws Exception;
 	public List<Agreement> getActiveAgreementsByAgent(String agentId) throws BaseException;
 	public List<Agreement> getActiveAgreementsByMember(String memberId) throws BaseException;
	void savePreTerminateAgreement(List<Agreement> agreements) throws Exception;
	void saveTerminateAgreement(List<Agreement> agreementsToTerminate, String affectQuota, String affectCommission,
			double refundToMember, User user) throws Exception;
	 void savePreChangeMembership(Agreement agreement, Membership toMembership, String remark, User user)
			throws Exception;
 	public void saveAgentCommission(Agent agent, int month, int year) throws Exception;
	void updateAgreementNewCommission(List<Agreement> agreements, CommissionSchemaPaymentRange range, int month,
			int year) throws Exception;
	public List<InstallmentSchema> getInstallmentSchema() throws Exception;
	public void saveReshedule(Agreement agreement, String installmentSchemaId, User user) throws Exception;
	public void saveFullPaymentReschedule(Agreement agreement, User thisUser) throws Exception;
	List<MicTask> getMicTask(String memberId) throws Exception;
	void saveInventory(PartnerProduct partnerProduct, Date fromDate, Date toDate, int numberOfRoom, String type,
			User user) throws Exception;
 
	void doSaveMemberPointAdjustment(MemberPointEntitle memberPointEntitle, String type, User user) throws Exception;
	Payment createNewAgreement(Member member, List<MemberIndAcct> list, User createdUser, Payment payment,
			PaymentDtl paytmentDtl, StandingInstruction instruction, Agreement agreement, double actualPayment)
			throws BaseException;
	public void doaAccruedDate(MemberPointEntitle c, Date accruedDate, User user)throws BaseException, Exception;
 
	void doSavePreAdvanceEntitlement(Agreement agreement, User user) throws Exception;
	void saveTerminateProspec(Member member, User user) throws Exception;
	  
}
